import { useState } from 'react';

interface IInputProps {
  children: (value: string) => JSX.Element;
}

export default function Input(props: IInputProps) {
  const [value, setValue] = useState<string>('');

  return (
    <>
      <input type="text" value={value} onChange={(e) => setValue(e.target.value)} placeholder="Temp in °C" />
      {props.children(value)}
    </>
  );
}
